<?php if (!defined('THINK_PATH')) exit();?><script type="text/javascript">
    $(function() {
        $('#add_advert_upload').uploadify({
                    'formData'     : {
                        'timestamp' : '<?php echo $timestamp;?>',
                        'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                    },
                    'swf'      : '/redbag/Public/js/uploadify/uploadify.swf',
                    'uploader' : '<?php echo U('Pay/public_uploadHead');?>',
                'buttonText': '图片上传',
                'width'	: 70,
                'height': 26,
                'removeTimeout':0,
                'buttonClass': 'upload_button',
                'onUploadSuccess' : function(file, data, response){
            var data = $.parseJSON(data);
            if(!data.status){
                $.messager.alert('提示信息', data.info, 'error');
            }else{
                $('#add_advert_url').attr('value',data.url);
                $.messager.alert('提示信息', data.info, 'info');
            }
        }
    });

        $.formValidator.initConfig({formID:"payAddForm",theme:'App',onSuccess:payAddUploadSave,inIframe:true});
    });
    function payAddUploadSave(){
        $.post('<?php echo U('Pay/add');?>', $("#payAddForm").serialize(), function(data){
            if(!data.status){
                $.messager.alert('提示信息', data.info, 'error');
            }else{
                payRefreshList();
                $.messager.alert('提示信息', data.info, 'info');
                $('#payAddBox').dialog('close');
            }
        })
    }
</script>
<form id="payAddForm" style="padding: 10px;">
    <table id="editBox">
        <tr>
            <td width="100" align="center">支付方式</td>
            <td>
                <!--<input type="text" id="remark" name="info[remark]" value="" style="width: 400px; height: 20px;">-->
                <select name="info[type]">
                    <option value="1">支付宝</option>
                    <option value="2">微信</option>
                    <option value="3">银行卡</option>
                </select>
            </td>
        </tr>
        <tr>
            <td width="100" align="center">支付账号</td>
            <td><input type="text"  name="info[account]"
                       value="" style="width: 450px;height: 20px;"></td>
            <td><div id="add_advert_urlTip"></div></td>
        </tr>

        <tr>
            <td width="100" align="center">持卡人(开户行)</td>
            <td><input type="text"  name="info[person]"
                       value="" style="width: 450px;height: 20px;"></td>
            <td><div id=""></div></td>
        </tr>

        <tr>
            <td width="100" align="center">支付图片</td>
            <td>
                <div id="queue"></div>
                <input type="hidden" id="add_advert_url" name="info[headsmall]">
                <input id="add_advert_upload" name="add_advert_upload" type="file" multiple="false">
            </td>
        </tr>
    </table>
</form>